/**
 * @Date 2023-02-21 14:24:10
 * @Remark
 */

// API -------------------------------------------------------------

export const API_ROLE_PAGE: Api = {
  title: "角色分页",
  path: "role/list",
  method: "POST",
  remark: "后台权限接口",
};

// req
export interface ReqRolePage extends ReqPage {
  name?: string;
}

// API -------------------------------------------------------------

export const API_ROLE_LIST: Api = {
  title: "角色列表",
  path: "role/all",
  method: "POST",
  remark: "后台权限接口",
};

// API -------------------------------------------------------------

export const API_ROLE_ADD: Api = {
  title: "添加角色",
  path: "role/add",
  method: "POST",
  remark: "后台权限接口",
};

// req
export interface ReqRoleAdd {
  name: string;
}

// API -------------------------------------------------------------

export const API_ROLE_UPDATE: Api = {
  title: "编辑角色",
  path: "role/update",
  method: "POST",
  remark: "后台权限接口",
};

// req
export interface ReqRoleUpdate extends ReqById, ReqRoleAdd {}

// API -------------------------------------------------------------

export const API_ROLE_DEL: Api = {
  title: "删除角色",
  path: "role/delete",
  method: "POST",
  remark: "后台权限接口",
};

// req
export interface ReqRoleDel {
  id: string;
}

// API -------------------------------------------------------------

export const API_ROLE_PERMISSION: Api = {
  title: "获取角色权限",
  path: "role/rolePermlist",
  method: "POST",
  remark: "后台权限接口",
};

// req
export interface ReqRolePermission {
  id: string;
}

// API -------------------------------------------------------------

export const API_ROLE_PERMISSION_ADD: Api = {
  title: "角色添加权限",
  path: "role/setRolePerm",
  method: "POST",
  remark: "后台权限接口",
};

// req
export interface ReqRolePermissionEdit {
 id: string;
  permissionId: string;
}

// res

// API -------------------------------------------------------------

export const API_ROLE_PERMISSION_DEL: Api = {
  title: "角色删除权限",
  path: "role/unsetRolePerm",
  method: "POST",
  remark: "后台权限接口",
};

// res
export const API_PERMISSION_LIST: Api = {
  title: "权限列表",
  path: "permission/all",
  method: "POST",
  remark: "权限控制器",
};

// API -------------------------------------------------------------

// export const API_ROLE_MENU: Api = {
//   title: "获取角色菜单",
//   path: "role/role_menu_list",
//   method: "POST",
//   remark: "后台权限接口",
// };

// // req
// export interface ReqRoleMenu {
//   roleId: string;
// }

// // data
// export interface DataRoleMenu {
//   id: string;
//   roleId: string;
//   menuName: string;
// }

// API -------------------------------------------------------------

// export const API_ROLE_MENU_ADD: Api = {
//   title: "角色添加菜单",
//   path: "role/add_role_menu",
//   method: "POST",
//   remark: "后台权限接口",
// };

// // req
// export interface ReqRoleMenuEdit {
//   roleId: string;
//   menuId: string;
// }

// res

// API -------------------------------------------------------------

// export const API_ROLE_MENU_DEL: Api = {
//   title: "角色删除菜单",
//   path: "role/delete_role_menu",
//   method: "POST",
//   remark: "后台权限接口",
// };
